home *** CD-ROM | disk | FTP | other *** search
- ********* CDIBs unit for Delphi 2.0 - Author: Lubomir Antonov
-
- --------------- DESCRIPTION
-
- The CDIBs unit exports a class TDIB. The class provides easy access to device-
- independant bitmaps. TDIB parallels TBitmap in its interface and functionality, but
- TBitmap works with DDBs (device-dependant bitmaps). Therefore, if a DIB is ever assigned to
- a TBitmap object, it will be converted to the current screen resolution and assigned the
- currently realized palette (if it does not have one of its own).
-
- TDIB will allow you to manipulate DIBs (copying to and from the clipboard, files,
- the resource file and yes, even a TBitmap object). If you need to display the DIB, assign
- it to a TBitmap.
-
- **** IMPORTANT for Windows NT:
- The TDIB class also solves a problem (a bug I would say) in the TBitmap class -
- under Windows 95, if you have a CF_DIB format on the Clipboard and you assign the Clipboard
- to a TBitmap object, Windows 95 will automatically provide a CF_BITMAP and CF_PALETTE
- formats. But under Windows NT this conversion is not performed and the assignment will fail.
- (If you don't beleive me, have a look at the source code for the TBitmap class). By using
- a TDIB class, you can read the CF_DIB data and then assign the TDIB object to a TBitmap
- object.
-
-
- --------------- DISCLAIMER
-
- The CDIBs unit is provided as is and without warranties or guaranties of any kind.
- Any loss or damage resulting from the use of the software is not the responsibility of the
- author.
-
-
- --------------- DETAILS
-
- Initializing a TDIB:
-
- - Use the Assign method to assign the Clipboard, another TDIB or a TBitmap
- to the TDIB object.
-
- - To load the DIB from a file or a resource call the methods LoadFromFile,
- LoadFromResourceName and LoadFromResourceID.
-
- Others:
-
- For most of the functionality of TDIB you can look at the decoumentation
- for TBitmap - all of the TBitmap methods that make sence for DIBs are
- implemented in TDIB. In addition there are some simple image processing
- methods.
-
- - CopySection extracts a rectangular portion of the current DIB and assigns
- it to the object.
- - You can use the CanConvert16to24 and Convert16to24 to convert
- 16-bit to 24-bit bitmaps (I found the hard way that most image processing
- applications can not read 16-bit bitmaps!).
- - And finally, the DIBtoBitmap method creates a DDB and palette from the DIB.
-
- - TDIB objects can be assigned to the Clipboard, another TDIB or a TBitmap.
- I suggest that if you need to preserve the DIB format, handle it using
- a TDIB and use TBitmap.Assign( TDIB ) in order to display.
-
-
- --------------- SOURCE CODE & USAGE
-
- You can use the CDIBs unit without any restrictions with only one condition: send
- me an e-mail (or snail mail - see address below) saying that you are using the software.
- I would appreciate any comments you might have, too. No names necessary - I just want to
- how useful the TDIB class is.
- My e-mail address is:
-
- lubomira@corel.com
-
- You can use the CDIBs unit without any restrictions. However, you might need to
- change some of the functionality of the TDIB class, or add to it. After all, I started TDIB
- because I needed to change functionality of TBitmap. Instead of reinventing the wheel, as I
- had to do, because of the very limiting implementation of TBitmap, you can have the source
- code for TDIB. For $5, though.
- If you want the source code for the CDIBs unit, send a cheque or money order for
- $5 to:
-
- Lubomir Antonov
- 301 - 2201 Riverside Dr.
- Ottawa, ON
- K1H 8K9
- Canada
-
- Please include a return e-mail address (for an e-mail attachment), a CompuServe
- address or mailing address (for a diskette). Or include a phone number to confirm an
- arrangement.